<?php include_once('header.php');?>
	<div class="main-content">
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
			<ul class="breadcrumb">
				<li>
					<i class="icon-home home-icon"></i>
					抽奖管理
				</li>
				<li>
					抽奖列表
				</li>
			</ul>
		</div>
		<div class="page-content">
			<div class="page-header">
				<h1 class="blue"><i class="icon-edit"></i> 编辑抽奖信息</h1>
			</div>										
			<div class="alert alert-block alert-success">
				<button type="button" class="close" data-dismiss="alert">
					<i class="icon-remove"></i>
				</button>
				<i class="icon-comment-alt"></i> 尊敬的管理员您好，排序规则:前端显示按照排序往下显示1→999！
			</div>
			<div class="row">
				<div class="col-xs-12">
					<form class="form-horizontal" enctype="multipart/form-data" role="form" method="post" action="/www/user_code/edit"  onsubmit="return check()">
						<input type="hidden" class="form-control" id="id" name="id" value="<?php echo $data['id'];?>">
						<div class="form-group">
							<label for="title" class="col-sm-1 control-label">抽奖码:</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" readonly="readonly" value="<?php echo $data['code_id'];?>">
							</div>
						</div>
						<div class="form-group">
							<label for="title" class="col-sm-1 control-label">抽奖时间:</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" readonly="readonly" value="<?php echo date("Y-m-d H:i",$data['create_time']);?>">
							</div>
						</div>
						<div class="form-group">
							<label for="title" class="col-sm-1 control-label">排序:</label>
							<div class="col-sm-8">
								<input type="text" class="form-control" id="order_id" name="order_id" value="<?php echo $data['order_id'];?>">
							</div>
						</div>
						<div class="form-group">
							<label for="title" class="col-sm-1 control-label">备注:</label>
							<div class="col-sm-8">
								<textarea class="form-control" rows="4" name="remark"><?php echo $data['remark'];?></textarea>
							</div>
						</div>
					 	<div class="form-group">
					   		<div class="col-sm-offset-1 col-sm-10">
								<button type="submit" id="submit" class="btn btn-primary">确定</button>
								<button type="submit" id="cancel" class="btn btn-primary">取消</button>
							</div>
					  	</div>
					</form>	
				</div>
			</div>					
		</div>													
	</div>
<?php include_once('content.php');?>
	<link href="/public_source/www/assets/css/ace.min.css" rel="stylesheet" />	
	<link href="/public_source/www/assets/css/jquery.tag-editor.css" rel="stylesheet"/>
    <script src="/public_source/www/assets/js/bootbox.min.js"></script>  
	<script src="/public_source/www/assets/js/jquery.tag-editor.min.js"></script>
<?php include_once('footer.php');?>	
<script type="text/javascript">
	$(document).ready(function(){
		$("#cancel").click(function() {
			window.location.replace('/www/user_code/code_list');
			return false;
		});
	});
	function check() {
	   var order_id = document.getElementById("order_id").value;
	   if(order_id ==  null || order_id == '' || order_id > 999) {
	        alert("排序格式错误");
	        return false;
	   }
	   return true;
	}			
</script>